package com.yl.auth.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yl.auth.model.entity.QianZaiKeHu;
import com.yl.auth.model.vo.LaoFangChuangVo;
import com.yl.auth.model.entity.Laoren;
import com.yl.auth.model.vo.LaorenVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yl
 * @since 2023-06-15
 */
public interface LaorenMapper extends BaseMapper<Laoren> {

    @Select("select max(id) from laoren")
    Long maxLaoId();

    Page<LaoFangChuangVo> getPage(Page<LaoFangChuangVo> page1, @Param("name") String name,@Param("searchParam") String searchParam);
    @Select("select * from laoren where status = 0")
    List<Laoren> find();
    @Select("select * from laoren where status = 1")
    List<Laoren> updateFind();


    Page<LaoFangChuangVo> findAll(Page<LaoFangChuangVo> page1, @Param("name") String name);

    void insertLaoRen(@Param("list") List<Laoren> list);

    @Select("select name from laoren where id = #{id}")
    String get(@Param("id") Long id);

    List<Laoren> listlaoren(Integer id);

    //@Select("select l.*,h.dengji from laoren l left join hulidengji h on l.care_level_id=h.id where l.id=#{id}")
    LaorenVo getLao(@Param("id") Long id);
}
